<template>
	<view class="container">
		<l-file ref="lFile" @up-success="upSuccess"></l-file>
		<view class="top">
			<view class="tdmc  u-m-l-30">
				<text>服务名称</text>
				<text class="right">{{model.name}}</text>
			</view>
			<view class="tdmc  u-m-l-30">
				<text>服务类别</text>
				<text class="right">{{model.demand.lb}}</text>
			</view>
			<view class="tdmc  u-m-l-30">
				<text>服务内容</text>
				<text class="right">{{model.demand.fwnr}}</text>
			</view>
			<view class="tdmc   u-m-l-30">
				<text>诚信保证金</text>
				<text class="right" v-if="model.demand.zsbzj == '需要'">{{model.demand.integrityDeposit}}元</text>
				<text class="right" v-else>{{model.demand.zsbzj}}</text>
			</view>
			<view class="fgx">

			</view>
		</view>
		<view class="jiafang" v-if="model.partyA">
			<view class="u-font-30 xmfp u-m-l-30 u-m-t-30">甲方</view>
			<view class="u-flex u-col-center u-p-20 u-m-20">
				<view class="xmkk" :style="{ backgroundImage: 'url(' + logoMask + ')' }">
					<text class="u-line-2">{{ model.partyA.username }}</text>
				</view>
				<view class="whql">
					{{ model.partyA.username }}
					<view class="u-m-t-20">
						<text class="bzj">保证金</text>
						<text class="bzje" v-if="model.demand && model.demand.integrityDeposit">￥{{ model.partyA.bond || 0 }}</text>
						<text class="bzje" v-else>不需要</text>
					</view>
				</view>
				<view><u-icon name="arrow-right" color="#888E9A" size="28" class="u-m-r-20"></u-icon></view>
			</view>
		</view>
		<block v-if="model.users != undefined">
		<view class="fgx"></view>
		<view class="jiafang" v-if="model.users.length > 1">
			<view class="u-font-30 xmfp u-m-l-30 u-m-t-30">
				乙方
			</view>
			<view class="u-flex u-flex-wrap u-p-20">
				<block v-for="(item,index) in model.users" :key="index">
			<view @click="showTeamMember(item)" class="u-flex u-col-center u-m-20" v-if="index > 0">
				<view class="xmkk" :style="{ backgroundImage: 'url(' + logoMask + ')' }">
					<text class="u-line-2">{{item.username}}</text>
					 <view class="tip" v-if="item.type == 10">团</view>
				</view>
				
			</view>
				</block>
			</view>
		</view>
		</block>
		<block v-if="showTeam">
		<view class="fgx"></view>
		<view class="u-m-t-30 u-m-l-10 u-m-r-10 ">
			<view class="u-flex u-row-between tdcy" @click="selectShow(0)">
				<view class="u-font-30 u-m-l-20" style="font-weight: bold;">团队成员</view>
				<view class="u-flex u-row-center u-m-r-30" style="margin-left: auto;">
					<text class="u-font-30" style="color: #AB61FF;" >{{ teamMembers.length || 1 }}个</text>
				</view>
				<u-icon name="arrow-down" style="margin-right: 20upx;" @click="selectShow(0, true)" v-if="!flagList[0]"></u-icon>
				<u-icon name="arrow-up" style="margin-right: 20upx;" @click="selectShow(0, false)" v-if="flagList[0]"></u-icon>
			</view>
			<block v-if="teamMembers.length > 0">
				<view v-for="(item, index) in teamMembers" :key="index">
					<view class="f-list u-row-between u-border-bottom u-flex u-m-r-20 u-m-l-20 u-p-t-20 u-p-b-20" v-show="flagList[0]" @click="showChildren(index)">
						
						<view class="u-flex">
							<view class="qylg" :style="{ backgroundImage: 'url(' + logoMask + ')' }">
								<text class="u-line-2">{{ item.name }}</text>
							</view>
							<view class="f-item u-m-l-32">
								<view class="title u-flex u-row-between">
									<view class="">
										<text class="name">{{ item.name }}</text>
									</view>
									<view class="bzj" v-if="item.bond">
										<text>￥{{ item.bond }}</text>
									</view>
								</view>
								<view class="explain" v-if="item.bond === null">未交保证金</view>
							</view>
						</view>		
						
					</view>
				</view>
			</block>
			<view v-else>
				<view class="f-list u-row-between u-border-bottom u-flex u-m-r-20 u-m-l-20 u-p-t-20 u-p-b-20">
					
						
						<view class="u-flex">
							<view class="qylg" :style="{ backgroundImage: 'url(' + logoMask + ')' }">
								<text class="u-line-2">{{ teamMembers.username }}</text>
							</view>
							<view class="f-item u-m-l-32">
								<view class="title u-flex-col">
									<view class="">
										<text class="name">{{ teamMembers.username }}</text>
									</view>
									<view class="explain" v-if="teamMembers.bond === null">未交保证金</view>
								</view>
							</view>
						</view>
						<block v-if="teamMembers.id != $store.state.userInfo.id">
						<view class="scxy u-flex u-row-center" v-if="!teamMembers.bond && model.demand && model.demand.integrityDeposit" @click="pay">缴纳保证金</view>
						</block>
				</view>
			</view>
		</view>
		</block>
		<view class="fgx"></view>
		<view class="middle-tdxy" style="overflow: hidden;">
			<view @click="selectShow(2)" class=" u-flex u-row-between u-m-l-30 u-m-t-30">
				<view class="u-font-30 xmfp">合同签订</view>
				<view class="u-flex u-row-between">
					<view class="scxy" style="margin-right: 30upx;">
						<image style="" src="../../static/img/jh.png" mode=""></image>
						<text @click="onUpload(true)">上传协议</text>
					</view>
					<u-icon name="arrow-down" style="margin-right: 20upx;" @click="selectShow(2,true)" v-if="!flagList[2]"></u-icon>
					<u-icon name="arrow-up" style="margin-right: 20upx;" @click="selectShow(2,false)" v-if="flagList[2]"></u-icon>
				</view>
			</view>			
			<view v-for="(item,index) in model.fileAgrees" :key="index" class="tdxy u-m-l-30 u-m-t-30" @click="loadFile(item.path)" v-if="flagList[2]">
				<view class="word u-m-l-30 u-p-t-30">
					<image src="../../static/img/word.png" mode=""></image>
					<text class="u-line-1">{{item.oldName}}</text>
				</view>
				<view class="sctime u-m-l-30 u-m-r-30 u-p-t-30 u-flex u-row-between">
					<view class="u-flex">
						<text class="scsj">上传时间:</text>
						<text class="sctime">{{ item.uploadTime }}</text>
					</view>
					<view v-if="$store.state.userInfo.id == item.userId" @click="delFile(item.id)">删除</view>
				</view>
			</view>
		</view>
		<view class="fgx u-m-t-30">
		</view>
		
		<view :hidden="userFeedbackHidden" class="popup_content">
			<view class="popup_title">进度名称</view>
			<view class="popup_textarea_item">
				<textarea class="popup_textarea" placeholder='请输入进度名称' v-model="feedbackContent">
				</textarea>
				<view @click="submitFeedback()">
					<button class="popup_button">提交</button>
				</view>
			</view>
		</view>
		<view class="popup_overlay" :hidden="userFeedbackHidden" @click="hideDiv()"></view>
		<view class="middle-hyjy  u-m-t-30">
			<view class="middle-hyjy  u-m-t-30">
				<view @click="selectShow(3)" class=" u-flex u-row-between u-m-l-30 ">
					<view class="u-font-30 xmfp">会议纪要</view>
					<view class="u-flex u-row-between">
						<view @click="tonewSummary(id)" class="scxy" style="margin-right: 30upx;">
							<image style="" src="../../static/img/jh.png" mode=""></image>
							<text>新增纪要</text>
						</view>
						<u-icon name="arrow-down" style="margin-right: 20upx;" @click="selectShow(3,true)" v-if="!flagList[3]"></u-icon>
						<u-icon name="arrow-up" style="margin-right: 20upx;" @click="selectShow(3,false)" v-if="flagList[3]"></u-icon>
					</view>
				</view>
				<view class="xhx" v-show="flagList[3]">
				</view>
				
				<view class="uni-padding-wrap uni-common-mt" v-show="flagList[3]">
					<swiper v-if="model.notepadRecords.length > 0" class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
						<swiper-item  v-for="(item,index) in model.notepadRecords" :key="index">
							<view class="u-m-l-30">
								<view class="u-flex u-m-t-35">
									<view class="ty">
									</view>
									<text class="xmjz">{{item.title}}</text>
									<text class="sctime" v-if="item.createTime != undefined">{{item.createTime.substr(0,10)}}</text>
								</view>
								<view class="u-flex">
									<view class="xx">
										
									</view>
									<view style="width: 100%;">
										<view class="zxjz u-m-t-15  u-m-b-15">
											{{item.content}}
										</view>
										<view class="u-flex" v-if="item.imgUrl != undefined">
											<view class="tp" v-for="(xitem,xindex) in item.imgUrl.split(',')" :key="xindex">
												<image @tap="previewImageStr(xindex,item.imgUrl)" :src="getImgUrl(xitem)" style="width: 100%;height: 100%;"></image>
											</view>
										</view>
										<view class="u-m-l-30 u-m-t-20 u-flex u-row-between u-col-center">
											<view class="u-flex u-col-center">
												<view class="tyqk">团员确认情况</view>
												<view class="hekuai" v-if="item.read != null">{{ item.read.length }}/{{ item.read.length + item.unread.length }}</view>
												<view class="hekuai" v-else>0/0</view>
												<view class="u-m-l-30" v-if="$store.state.userInfo.id == item.createUserId" @click="delSummary(item.id)">删除</view>
											</view>
											<view class="u-m-r-30"><image @click="toConfirmation(item)" class="sd" src="../../static/img/sd.png" mode=""></image></view>
										</view>
									</view>
								</view>
								
							</view>
						</swiper-item>
					</swiper>
				</view>
			</view>
			<view class="fgx"></view>
			<view class="u-m-t-30">
				<view @click="selectShow(4)" class="u-flex u-row-between u-p-l-30 u-p-r-20">
					<view class="u-font-30 xmfp">进度查询</view>
					<view class=" u-flex u-row-between u-m-l-30 ">		
						<view @click="xzjd" class="scxy" style="margin-right: 30upx;">
							<image style="" src="../../static/img/jh.png" mode=""></image>
							<text>新增进度</text>
						</view>
						<u-icon name="arrow-down" @click="selectShow(4,true)" v-if="!flagList[4]"></u-icon>
						<u-icon name="arrow-up" @click="selectShow(4,false)" v-if="flagList[4]"></u-icon>
					</view>
				</view>
				<view class="u-m-30 u-p-l-30" v-if="flagList[4]">
					<u-time-line>
						<u-time-line-item v-for="(item,index) in model.progress" :key="index" nodeTop="2" class="u-p-b-30">
							<template v-slot:node>
								<view class="u-node">
									<image src="../../static/img/icon_jd.png" style="height: 52rpx;width: 52rpx;" />
								</view>
							</template>
							<template v-slot:content>
								<view>
									<view class="u-order-title u-p-b-20">{{item.name}}</view>
									<view class="u-order-time">{{item.createTime}}</view>
									<view v-if="$store.state.userInfo.id == item.createUserId" @click="delSchedule(item.id)">删除</view>
								</view>
							</template>
						</u-time-line-item>						
					</u-time-line>
				</view>
			</view>
			
			<view class="fgx u-m-t-30 u-m-b-30">
			</view>
			<view class="u-m-l-30 u-m-t-30 u-p-b-50">
				<view @click="selectShow(5)" class="u-flex u-row-between tdcy">
					<view class="u-font-30" style="font-weight: bold;">
						文件
					</view>
					<view class="u-flex u-col-center">
						<view class="sc" style="margin-right: 30upx;">
							<image style="" src="../../static/img/jh.png" mode=""></image>
							<text @click="onUpload(false)">上传</text>
						</view>
						<u-icon name="arrow-down" style="margin-right: 20upx;" @click="selectShow(5,true)" v-if="!flagList[5]"></u-icon>
						<u-icon name="arrow-up" style="margin-right: 20upx;" @click="selectShow(5,false)" v-if="flagList[5]"></u-icon>
					</view>
					<!-- <view class="u-flex u-row-center u-m-r-16">
						<image @click="toFile" style="width: 48rpx; height: 48rpx;" src="../../static/register/xy.png"></image>
					</view> -->
				</view>
			
			</view>
			<view class=" u-p-t-20 u-p-b-20" v-if="flagList[5]">
				<block v-for="(item, index) in model.files" :key="item.id">
					<u-swipe-action
						:show="item.show"
						:index="index"
						v-if="$store.state.userInfo.id == item.userId"
						@click="delFiles"
						@open="openFiles"
						:options="options"
						style="width: 100%;"
					>
						<view class="f-list u-flex u-p-t-20 u-p-b-20 u-col-center" style="display: flex;justify-content: space-between;">
							<view class="qylg"><image style="width: 64rpx; height: 64rpx;" src="../../static/img/file.png" mode=""></image></view>
							<view class="f-item" style="flex: 1;" @click="onOpenDoc(item.path)">
								<view class="u-font-34">
									<text style="display:block;width:400rpx;" class="u-line-1">{{ item.oldName }}</text>
								</view>
								<view class="title u-flex u-m-t-12" style="width: 80%;">
									<text class="name">{{ item.userName }}</text>
									<view class="u-flex u-row-between" style="width: 100%;">
										<text class="rq">{{ item.uploadTime.substr(0, 10) }}</text>
										<text class="wjdx">{{ item.size / 1000 + 'KB' }}</text>
									</view>
								</view>
							</view>
							<view class="xz" @click="onDown(item.path)" style="margin-right: 20upx;">下载</view>
						</view>
					</u-swipe-action>
					<view class="f-list u-flex u-p-t-20 u-p-b-20 u-col-center" v-else style="display: flex;justify-content: space-between;">
						<view class="qylg "><image style="width: 64rpx; height: 64rpx;" src="../../static/img/file.png" mode=""></image></view>
						<view class="f-item " style="flex: 1;" @click="onOpenDoc(item.path)">
							<view class="u-font-34">
								<text style="display:block;width:400rpx;" class="u-line-1">{{ item.oldName }}</text>
							</view>
							<view class="title u-flex u-m-t-12" style="width: 80%;">
								<text class="name">{{ item.userName }}</text>
								<view class="u-flex u-row-between" style="width: 100%;">
									<text class="rq">{{ item.uploadTime.substr(0, 10) }}</text>
									<text class="wjdx">{{ item.size / 1000 + 'KB' }}</text>
								</view>
							</view>
						</view>
						<view class="xz" @click="onDown(item.path)" style="margin-right: 20upx;">下载</view>
					</view>
				</block>
			</view>
			
		</view>
		<view class="u-h-30"></view>

	</view>
</template>

<script>
	import lFile from '@/components/l-file/l-file.vue'
	export default {
		components: {
			lFile
		},
		data() {
			return {
			options: [
				{
					text: '删除',
					style: {
						backgroundColor: '#dd524d'
					}
				}
			],
				team:[],
				localPath: '',
				baseUrl: this.$mConfig.baseUrl,
				indicatorDots: true,
				autoplay: false,
				interval: 2000,
				duration: 500,
				flagList: [false, false, false, false, false, false],
				tbIndex: -1,
				id: 0,
				toggle: false,
				showHeight: 300,
				logoMask: this.$mAssetsPath.logoMask,
				bjxm: "../../static/homepage/xmkk.png",
				filelist: [],
				xmlist: [],
				list: [],
				model: {
					demand: {},
					intention: {},
					files: [],
					companys: [],
					fileAgrees: [],
					files: [],
					notepadRecords: [],
					team: {},
					teamProjects: [],
					teamUsers: []
				},
				isLeader: false,
				userId: '',
				show: true,
				userFeedbackHidden: true, // 默认隐藏
				feedbackContent: '', // 用户反馈内容
				teamChatId: '',
				showTeam:false,
				teamMembers:[]
			}
		},
		onLoad(options) {
			if (options.id) {
				this.id = options.id;
			}
			if (options.userId) {
				this.userId = options.userId;
			}
			if (options.teamChatId) {
				this.teamChatId = options.teamChatId;
				this.checkLeader();
			}
		},
		onShow() {
			this.initPage(this.id);
		},
		methods: {
			toConfirmation(item) {
				uni.navigateTo({
					url: '../../notepad/zhihuiTeam/confirmation?id='+item.id
				})
			},
			showTeamMember(item){
				this.showTeam = true;
				this.flagList[0] = true;
				if(item.fromTeamId){ 				
					var fromTeamId = item.fromTeamId.split('_')
					if (fromTeamId.length && fromTeamId[1] > 0) {
						let reqBody = {
							id: fromTeamId[1],
							type: 1
						}
						this.fetchGroupPersonBond(reqBody,item)
					}
				}else{
					this.fetchGroupPersonBond('',item)
				}
			},
			// async setProjectPartyB(id) {
			// 	console.log(id, this.id)
			// 	let { code } = await this.$apis.setProjectPartyB({ userId: id, teamChatId: this.teamChatId })
			// 	if (code == 200) {
			// 		uni.showToast({
			// 			title: '设置成功'
			// 		})
			// 	}
			// 	this.initPage(this.id)
			// },
			isNeedPay(val) {
				if (!val) val = 0
				if (this.model.demand.integrityDeposit) {
					let money = parseFloat(this.model.demand.integrityDeposit) - parseFloat(val)
					if (money > 0) {
						return true
					} else {
						return false
					}
				} else {
					return false
				}
			},
			async needPay(val) {
				var payMoney = this.model.demand.integrityDeposit;
				if(!val) val= 0;
				if(this.model.demand.integrityDeposit){
					payMoney = parseFloat(this.model.demand.integrityDeposit) - parseFloat(val)
				}
				var payData = { payMoney: payMoney, type: 1, id: this.id }
				let { data, code } = await this.$apis.createTeamPayBond(payData)
				console.log('createTeamPayBond', data)
				data.name = this.model.name;
				if (code == 200) {
					this.$mRouter.push({
						route: this.$mRoutesConfig.pay,
						query: {
							datas: JSON.stringify(data)
						}
					})
				}
			},
			async fetchGroupPersonBond(reqBody,item) {
				if(item.type == 10){
					
					let { data } = await this.$apis.fetchGroupPersonBond(reqBody)
					this.teamMembers = data;
				}else{
					this.teamMembers = item;
				}
				console.log(this.teamMembers);
				this.$forceUpdate()
			},
			showChildren(index) {
				let users = this.model.users
				if (users && users[index] && users[index].type == 10) {
					var fromTeamId = users[index].fromTeamId.split('_')
					console.log('fromTeamId', fromTeamId)
					if (fromTeamId.length && fromTeamId[1] > 0) {
						let reqBody = {
							id: fromTeamId[1],
							type: 1
						}
						this.fetchGroupPersonBond(reqBody, index)
					}
				}
			},	
			delSchedule(id){
				var that = this;
				uni.showModal({
					content:"删除该进度",
					success(res) {
						if(res.confirm) that.deleteNplusoneProgress(id);
					}
				})
			},
			async deleteNplusoneProgress(id){
				let {code} = await this.$apis.deleteNplusoneProgress({id:id});
				if(code == 200){
					this.initPage(this.id);
				}
			},
			// 如果打开一个的时候，不需要关闭其他，则无需实现本方法
			open(index) {
				// 先将正在被操作的swipeAction标记为打开状态，否则由于props的特性限制，
				// 原本为'false'，再次设置为'false'会无效
				this.courses[index].show = true
				this.courses.map((val, idx) => {
					if (index != idx) this.courses[idx].show = false
				})
			},
			delFiles(index) {
				var that = this
				uni.showModal({
					content: '删除该文件',
					success(res) {
						if (res.confirm) that.deleteFileAgrees(index)
					}
				})
			},
			async deleteFileAgrees(index) {
				let { code } = await this.$apis.deleteFileAgree({ id: this.model.files[index].id })
				if (code == 200) {
					this.model.files.splice(index, 1)
				}
			},
			// 如果打开一个的时候，不需要关闭其他，则无需实现本方法
			openFiles(index) {
				console.log('open', index)
				// 先将正在被操作的swipeAction标记为打开状态，否则由于props的特性限制，
				// 原本为'false'，再次设置为'false'会无效
				this.model.files[index].show = true
				this.model.files.map((val, idx) => {
					if (index != idx) this.model.files[idx].show = false
				})
			},
			delFile(id) {
				var that = this
				uni.showModal({
					content: '删除该文件',
					success(res) {
						if (res.confirm) that.deleteFileAgree(id)
					}
				})
			},
			async deleteFileAgree(id) {
				let { code } = await this.$apis.deleteFileAgree({ id: id })
				if (code == 200) {
					this.initPage(this.id)
				}
			},
			delSummary(id) {
				var that = this
				uni.showModal({
					content: '删除该纪要',
					success(res) {
						if (res.confirm) that.deleteNotepadRecord(id)
					}
				})
			},
			async deleteNotepadRecord(id) {
				let { code } = await this.$apis.deleteNotepadRecord({ id: id })
				if (code == 200) {
					this.initPage(this.id)
				}
			},
			async checkLeader() {
				let result = await this.$apis.checkLeader({
					teamChatId: this.teamChatId
				});
				this.isLeader = result.data;
				if (!this.isLeader && this.userId != '') {
					this.show = false;
				}
			},
			
			getImgUrl(url) {
				return this.$mConfig.baseUrl + url;
			},
			hideDiv() { // 隐藏输入弹出框
				this.userFeedbackHidden = true;
			},
			async submitFeedback() { // 新增进度
					var _this =this;
					let req = {};
					req.businessId = _this.id;
					req.name = _this.feedbackContent;
					req.type = '12';
					if(this.userId != '') req.userId = this.userId;
					let result = await this.$apis.newProgress(req);
					if(result.code==200){
						this.userFeedbackHidden = true;
						uni.showToast({
							title: "新增成功",
							icon: 'none'
						});
						this.initPage(this.id);
					}
				   // 提交反馈内容
					console.log(_this.feedbackContent);
			},
			previewImageStr(index, files) { //预览图片
				let imgs = [];
				if (files.indexOf(',') == -1) {
					imgs = [files];
				} else {
					imgs = files.split(',');
				}
				let urls = [];
				for (var i in imgs) {
					urls.push(this.$mConfig.baseUrl + imgs[i]);
				}
				console.log(urls);
				uni.previewImage({
					current: index,
					urls: urls
				});
			},
			selectShow(index, flag) {
				this.flagList[index] = !this.flagList[index];
				this.initPage(this.id);
			},
			scroll(event) {
				//距离每个边界距离
				console.log(event.detail)
			},
			//滚动到底部/右边触发
			scrolltolower() {
				console.log(1111);
			},
			// 滚动到顶部/左边触发
			scrolltoupper() {
				console.log(2222);
			},
			downloadFile(url) {
				uni.downloadFile({
					url: this.$mConfig.baseUrl + url, //仅为示例，并非真实的资源
					success: (data) => {
						if (data.statusCode === 200) {
							
							//文件保存到本地
							uni.saveFile({
								tempFilePath: data.tempFilePath, //临时路径
								success: function(res) {
									uni.showToast({
										icon: 'none',
										mask: true,
										title: '文件已保存：' + res.savedFilePath, //保存路径
										duration: 3000,
									});
									setTimeout(() => {
										//打开文档查看
										uni.openDocument({
											filePath: res.savedFilePath,
											success: function(res) {
												// console.log('打开文档成功');
											}
										});
									}, 3000)
								}
							});
						}
					}
				});
			},
			onOpenDoc(file) {
				let url = this.$mConfig.baseUrl + file;
				/* 下载返回临时路径（退出应用失效） */
				this.$refs.lFile.download(url)
					.then(path => {
						/* 预览 */
						this.$refs.lFile.open(path);
					});
			},
			/* 保存 */
			onDown(file) {
				let url = this.$mConfig.baseUrl + file;
				this.$refs.lFile.download(url, 'local')
					.then(path => {
						this.localPath = path;
					});
			},
			/* 上传 */
			onUpload(flag) {
				this.$refs.lFile.upload({
					// #ifdef APP-PLUS
					// nvue页面使用时请查阅nvue获取当前webview的api，当前示例为vue窗口
					currentWebview: this.$mp.page.$getAppWebview(),
					// #endif
					//非真实地址，记得更换,调试时ios有跨域，需要后端开启跨域并且接口地址不要使用http://localhost/
					url: this.$mConfig.baseUrl + "/notepad/saveFile",
					//默认file,上传文件的key
					name: 'file',
					// header: {'Authorization':'token'},
					//...其他参数
					formData: {
						'businessId': this.id,
						'isAgree': flag,
						'type': 12,
						'userId': this.userId
					},
					header: {
						"X-requested-With": "XMLHttpRequest",
						"ZC-TOKEN": uni.getStorageSync('token')
					}
				});
			},
			upSuccess(res) {
				this.initPage(this.id);
			},
			loadFile(file) {
				uni.downloadFile({
					url: this.$mConfig.baseUrl + file,
					success: function(res) {
						var filePath = res.tempFilePath;
						uni.openDocument({
							filePath: filePath,
							success: function(res) {
								console.log('打开文档成功');
							}
						});
					}
				});
			},

			xzjd() { // 显示输入弹出框
				this.userFeedbackHidden = false;
			},
			// async initPage(id) {
			// 	let result = await this.$apis.notebookServer({
			// 		id: id
			// 	});
			// 	this.model = result.data;
			// 	this.$forceUpdate()
			// },
			tonewSummary(id) {
				let param = '';
				if (this.userId != '') param = "&userId=" + this.userId;
				uni.navigateTo({
					url: "../notepad/zhihuiTeam/newSummary?&type=12&id=" + id + param
				})
			},
			async initPage(id) {
				let reqBody = {
					id: id,
					type: 12
				};
				if (this.userId != '') reqBody['userId'] = this.userId;
				let result = await this.$apis.summary(reqBody);
				this.model = result.data;
				var users = []
				if (this.model.demand && this.model.demand.integrityDeposit) {
					for (var i in this.model.users) {
						users[i] = this.model.users[i]
						users[i].children = []					
						users[i].show = false
						if (this.model.users[i].blod && this.model.users[i].id == that.$store.state.userInfo.id) {
							that.myblod = this.model.users[i].blod
						}
					}
				} else {
					for (var i in this.model.users) {
						users[i] = this.model.users[i]
						users[i].children = []			
						users[i].show = false
					}
				}
				this.model.users = users
			}
		},

	}
</script>

<style scoped lang="scss">
	.yfbsz {
		width: 750rpx;
		height: 92rpx;
		background: #ffebd7;
		color: #FF8F28;

		.nr {
			color: #FF8F28;
			font-size: 30rpx;
			text-align: center;
			width: 27%;

		}

	}

	.whql {
		flex: 1;
		margin-left: 30rpx;
	}


.bzj {	
	background: #4b9cff;
	border-radius: 4rpx;
	padding:0 8rpx;
	color: #ffffff;
	margin-left:10rpx;
}

	.bzje {

		color: #AB61FF;
	}

	.u-order-title {
		color: #4B9CFF;
		font-size: 30rpx;
	}

	.u-order-time {
		color: #888D99;
	}

	.tdmc {
		border-bottom: 2rpx solid #DADFED;
		padding: 30rpx;

		text {
			font-size: 30rpx;
			color: #0D1D36;
		}

		.right {
			position: absolute;
			left: 40%;
		}

		.rightwu {
			position: absolute;
			left: 55%;
		}

		.jine {
			// position: absolute;
			// left: 228rpx;
			font-size: 30rpx;
			color: #AB61FF;
		}
	}

	.tdmcbg {

		background: #F5F5F9;
		width: 100%;
	}

	.tdtebie {
		border-bottom: none;
	}

	.fgx {
		width: 100%;
		height: 20rpx;
		background-color: #F5F5F9;
		margin-top: 30rpx;
	}

	.xmkk {
		width: 118rpx;
		// border: 1px solid;
		height: 136rpx;
		text-align: center;
		background-repeat: no-repeat;
		background-size: 100% auto;
		background-position: 0 bottom;
		overflow: hidden;
		display: flex;
		justify-content: center;
		align-items: center;
		position: relative;
		text {
			color: #888d99;
			padding: 0 10rpx;
			font-size: 28rpx;
		}
		.tip {
		    position: absolute;
		    bottom: 0;
		    right: 0;
		    z-index: 1;
		    border-radius: 15rpx;
		    height: 36rpx;
		    width: 40rpx;
		    background: #19c07d;
			color: #fff;
		    text-align: center;
		    font-size: 16rpx;
		}
	}
	.xmfp {
		color: #0D1D36;
		font-weight: bold;
	}

	.xmfpxj {
		width: 690rpx;
		height: 600rpx;
		background: #F5F5F9;
		border-radius: 10rpx;

		.tubiao {
			color: #0D1D36;
			font-size: 30rpx;
		}

		.xhx {
			width: 100%;
			height: 1rpx;
			background-color: #CACEDB;
			margin-top: 20rpx;
		}
	}

	.qylg {
		width: 102rpx;
		height: 118rpx;
		background-size: 100% auto;
		background-position: 0 bottom;
		overflow: hidden;
		text-align: center;
		display: flex;
		justify-content: center;
		align-items: center;

		text {
			color: #888D99;
			margin:0 10rpx;
			font-size: 20rpx;
		}
	}

.td {
	padding:0 5rpx;
	color: #ffffff;
	font-size: 24rpx;
	height: 36rpx;
	background: #19C07D;
	border-radius: 6rpx;
	margin-left: 20rpx;
}
	.title {
		display: flex;
		justify-content: space-between;
	}

	.tz {
		width: 68rpx;
		color: #FFFFFF;
		font-size: 24rpx;
		height: 36rpx;
		background: #AB61FF;
		border-radius: 6rpx;
		margin-left: 20rpx;
	}

	.name {
		font-size: 30rpx;
		color: #0D1D36;
		font-weight: bold;
	}

	.explain {
		color: #888D99;
		font-size: 26rpx;
	}

	.fpbl {
		position: absolute;
		left: 500rpx;

		text {
			font-size: 24rpx;
			color: #4B9CFF;
		}

		.fpblsz {
			width: 68rpx;
			height: 36rpx;
			border: 2rpx solid #4B9CFF;
			border-radius: 6rpx;
			margin-left: 10rpx;
		}

		.bfh {
			font-size: 24rpx;
			margin-left: 15rpx;
		}
	}

	.ckqb {
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 26rpx;
		color: #FF8F28;
		margin-top: 30rpx;
	}

	.xhx {
		width: 100%;
		height: 2rpx;
		background-color: #DADFED;
		margin-top: 34rpx;
	}

	.scxy {
		display: flex;
		align-items: center;
		width: 190rpx;
		height: 52rpx;
		border: 2rpx solid #AB61FF;
		border-radius: 26rpx;
		color: #AB61FF;
		font-size: 26rpx;

		image {
			width: 30rpx;
			height: 30rpx;
			margin-top: 5rpx;
			margin-left: 26rpx;
		}
	}

	.tdxy {
		width: 690rpx;
		height: 159rpx;
		background: #F5F5F9;
		border-radius: 20rpx;

		.word {
			display: flex;
			align-items: center;

			image {
				width: 41rpx;
				height: 37rpx;
			}

			text {
				color: #4B9CFF;
				font-size: 30rpx;
				margin-left: 16rpx;
			}
		}
	}

	.scsj {
		color: #0D1D36;
		font-size: 26rpx;
	}

	.sctime {
		display: flex;
		align-items: center;
		color: #888D99;
		font-size: 30rpx;
		margin-left: 20rpx;
	}

	.ty {
		width: 18rpx;
		height: 18rpx;
		background: #888D99;
		border-radius: 50%;
	}

	.xmjz {
		color: #888D99;
		font-size: 30rpx;
		margin-left: 20rpx;
	}


	.xx {
		width: 2rpx;
		height: 2rpx;
		border: 2rpx dashed #888D99;
		opacity: 0.5;
		margin-left: 7rpx;
	}

	.zxjz {
		color: #0D1D36;
		font-size: 30rpx;
		font-weight: bold;
		margin-left: 40rpx;
		margin-top: -100rpx;
	}

	.tp {
		width: 192rpx;
		height: 192rpx;
		border-radius: 10rpx;
		background-color: #F5F5F9;
		margin-right: 30rpx;
		margin-left: 30rpx;
		margin-top: 24rpx;
	}

	.tyqk {
		color: #0D1D36;
		font-size: 26rpx;
	}

	.hekuai {
		color: #FFFFFF;
		font-size: 26rpx;
		width: 72rpx;
		height: 32rpx;
		background: #4F5A78;
		border-radius: 4rpx;
		text-align: center;
		line-height: 32rpx;
		margin-left: 22rpx;
	}

	.sd {
		width: 48rpx;
		height: 48rpx;
	}

	.word {
		display: flex;
		align-items: center;

		image {
			width: 41rpx;
			height: 37rpx;
		}

		text {
			color: #4B9CFF;
			font-size: 30rpx;
			margin-left: 16rpx;
		}
	}

	.qymc {
		width: 102rpx;
		height: 118rpx;
		background-repeat: no-repeat;
		background-size: 100% auto;
		background-position: 0 bottom;

		text {
			color: #888D99;
			font-size: 20rpx;
			line-height: 118rpx;
			margin-left: 8rpx;
		}
	}

	.sc {
		display: flex;
		align-items: center;
		width: 136rpx;
		height: 52rpx;
		border: 2rpx solid #AB61FF;
		border-radius: 26rpx;
		color: #AB61FF;
		font-size: 26rpx;

		image {
			width: 30rpx;
			height: 30rpx;
			margin-top: 5rpx;
			margin-left: 26rpx;
		}
	}

	.f-list {

		border-bottom: 2rpx solid #DADFED;

	}


	.name {
		font-size: 28rpx;
		color: #4C9CFF;
	}

	.tz {
		width: 68rpx;
		color: #FFFFFF;
		font-size: 24rpx;
		height: 36rpx;
		background: #AB61FF;
		border-radius: 6rpx;
		margin-left: 20rpx;
	}

	.xz {
		width: 114rpx;
		height: 50rpx;
		background: #4C9CFF;
		border-radius: 25rpx;
		color: #FFFFFF;
		font-size: 26rpx;
		text-align: center;
		line-height: 50rpx;
		float: right;
	}

	.rq {
		font-size: 28rpx;
		color: #888E9A;
	}

	.wjdx {
		font-size: 28rpx;
		color: #888E9A;
		margin-left: 20rpx;
	}

	.scroll-view_H {
		white-space: nowrap;

		.scroll-view-item_H {
			display: inline-block;
			width: 100%;
			height: 100px;
		}

		.uni-bg-red {
			background: red;
		}

		.uni-bg-green {
			background: green;
		}

		.uni-bg-blue {
			background: blue;
		}
	}

	.wjdx {
		font-size: 28rpx;
		color: #888E9A;
		margin-left: 20rpx;
	}

	.popup_overlay {

		position: fixed;
		top: 0%;
		left: 0%;
		width: 100%;
		height: 100%;
		background-color: black;
		z-index: 1001;
		-moz-opacity: 0.8;
		opacity: .80;
		filter: alpha(opacity=88);
	}

	.popup_content {
		position: fixed;
		top: 50%;
		left: 50%;
		width: 520upx;
		height: 550upx;
		margin-left: -270upx;
		margin-top: -270upx;
		border: 10px solid white;
		background-color: white;
		z-index: 1002;
		overflow: auto;
		border-radius: 20upx;
	}

	.popup_title {
		padding-top: 20upx;
		width: 480upx;
		text-align: center;
		font-size: 32upx;
	}

	.popup_textarea_item {
		padding-top: 5upx;
		height: 240upx;
		width: 440upx;
		background-color: #F1F1F1;
		margin-top: 30upx;
		margin-left: 20upx;
	}

	.popup_textarea {
		width: 410upx;
		font-size: 26upx;
		margin-left: 20upx;
	}

	.popup_button {
		color: white;
		background-color: #4399FC;
		border-radius: 20upx;
	}

	.swiper {
		height: 500rpx;
	}
</style>
